<?php
class Core_Model_Logger {
	
	public $loggerSaveData;
	
	public function __construct(){
		$this->loggerSaveData = new Core_Data_Logger;
	}
	
	public function saveData(){
		$accessLevel = $this->getAccessLevel();
		$username = $this->getUsername();
		$this->loggerSaveData->saveData($username, $accessLevel);
	}
	
	private function getAccessLevel(){
		if(isset($_SESSION['users_access_level'])){
			$accessLevel = $_SESSION['users_access_level'];
		}
		else {
			$accessLevel = '0';
		}
		return $accessLevel;
	}
	
	private function getUsername(){
		if(isset($_SESSION['users_username'])){
			$username = $_SESSION['users_username'];
		}
		else {
			$username = "GUEST";
		}
		return $username;
	}
}